<?php
namespace app\operator\validate;
use think\Validate;
class Seller extends Validate
{

    protected $rule=[
        'oid'=>'require',
        'name'=>'require|length:2,30',
        'phone'=>'require|length:7,15',
        'area'=>'require',
        'addr'=>'require',
        'addr'=>'require',
        'shopstart'=>'require',
        'shopend'=>'require',
        'averageprice'=>'require',
        'contacts'=>'require',
        'mobile'=>'regex:/^1[34578]\d{9}$/',
    ];


    protected $message=[
        'oid.require'=>'非法提交！！！！',
        'name.require'=>'请输入商户名称！',
        'name.length'=>'商户名称长度为2~30个字符！',
        'phone.require'=>'请输入商户电话！',
        'phone.length'=>'商户电话格式不正确！',
        'area.require'=>'请选择所在位置！',
        'addr.require'=>'请输入详细地址！',
        'shopstart.require'=>'请选择开始营业时间！',
        'shopend.require'=>'请选择结束营业时间！',
        'averageprice.require'=>'请输入人均消费！',
        'contacts.require'=>'请输入联系人！',
        'mobile.require'=>'请输入联系手机！',
        'mobile.regex'=>'联系手机格式不正确！',
    ];

    protected $scene=[
        'add'=>['name','phone','area','addrs','shopstart','shopend','averageprice','contacts','mobile'],
        'edit'=>['name','phone','area','addrs','shopstart','shopend','averageprice','contacts','mobile'],
        //'add'=>['name','phone','addr','shopstart','shopend','averageprice','contacts','mobile'],
        //'edit'=>['name','phone','addr','shopstart','shopend','averageprice','contacts','mobile'],
    ];
}